package guowei.guliproduct.product.config;


import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyRedissionConfig {

    /**
     * 所有对redisson的操作都是通过RedissonClient对象
     * @return
     */
    @Bean
    public RedissonClient redisson(){
        //1.创建配置
        Config config = new Config();
        config.useSingleServer().setAddress("redis://192.168.109.133:6379");

        //2.根据配置创建出RedissonClient示例
        RedissonClient redissonClient = Redisson.create(config);
        return redissonClient;
    }

}
